package cn.edu.ecut.se2024.Service;
import java.util.List;

import cn.edu.ecut.se2024.User.purchase;
import cn.edu.ecut.se2024.Service.service;
public class purchaseService {
	service s=new service();
	public purchase querypurchaseBysno(int sno) {
		return s.querypurchaseBysno(sno);
	}
	public List<purchase> queryAllpurchase(){
		return s.queryAllpurchase();
	}
	public boolean addpurchase(purchase p) {
		if(!s.isExist(p.getNumber())) {
			s.addpurchase(p);
			return true;
		}
		else {
			return false;
		}
	}
	public boolean deletepurchaseBysno(int sno) {
		if(s.isExist(sno)) {
			return s.deletepurchaseBysno(sno);
		}
		else {
			return false;
		}
	}
}